# 贪婪 和 非贪婪
import re

# 默认贪婪, 贪婪顺序:从左到右

str1 = 'wo shi num 77777-8888-999'
p = r'^(.+?)(\d+)-(\d+)-(\d+)$'
res = re.match(p, str1)
print(res.groups())
